﻿
using Abp.Application.Services.Dto;
using Abp.Web.Mvc.Authorization;
using KDS.Mes.Authorization;
using KDS.Mes.Mes.AlcCodeDetails;
using KDS.Mes.Mes.AlcCodeDetails.Dtos;
using KDS.Mes.Web.Models.AlcCodeDetails;
using System;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace KDS.Mes.Web.Controllers
{
    public class AlcCodeDetailsController : MesControllerBase
    {

        private readonly IAlcCodeDetailAppService _alcCodeDetailAppService;

        public AlcCodeDetailsController(IAlcCodeDetailAppService alcCodeDetailAppService)
        {
            _alcCodeDetailAppService = alcCodeDetailAppService;
           
        }

        public  ActionResult Index()
        {
		   var model = new GetAlcCodeDetailInput {FilterText = Request.QueryString["filterText"]};
            return View(model);



           
        }



        /// <summary>
        /// 根据id获取进行编辑或者添加的用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [AbpMvcAuthorize(AppPermissions.Pages_Bom_AlcCodeDetails_Create, AppPermissions.Pages_Bom_AlcCodeDetails_Edit)]
        public async Task<PartialViewResult> CreateOrEditAlcCodeDetailModal(int? id)
        {
		var input=new NullableIdDto<int>{Id=id};
	 
                 var output=    await _alcCodeDetailAppService.GetAlcCodeDetailForEditAsync(input);

				 var viewModel=new CreateOrEditAlcCodeDetailModalViewModel(output);


            return PartialView("_CreateOrEditAlcCodeDetailModal",viewModel);
        }
	 
       
    }
}